home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
mac
/
LOGIC Apple II 5.25" Library - ProDOS
/
PRO001.dsk
/
FIN
/
LOAN.CALC.TERM.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
785b
|
26 lines
10 PRINT "TERM OF A LOAN"
20 PRINT
29 REM - STATEMENTS 30 TO 100 REQUEST USER INPUT
30 PRINT "REGULAR PAYMENT";
40 INPUT R
50 PRINT "PRINCIPAL";
60 INPUT P
70 PRINT "ANNUAL INTEREST RATE";
80 INPUT I
90 PRINT "NUMBER OF PAYMENTS PER YEAR";
100 INPUT N
108 REM - CALCULATE TERM IN YEARS BY FORMULA;
109 REM - INTEREST CONVERTED FROM PERCENT TO DECIMAL FOR CALCULATION
110 Y = -( LOG(1 -(P *(I/100))/(N *R))/( LOG(1 +I/100/N) *N))
114 REM - CALCULATE YEARS AND MONTHS FROM YEARS
115 M = INT(Y *12 +.5)
116 Y0 = INT(M/12)
117 M = M -Y0 *12
119 REM - PRINT RESULTS
120 PRINT "TERM = ";Y0;" YEARS, ";M;" MONTHS"
130 PRINT
139 REM - RESTART OR END PROGRAM?
140 PRINT "MORE DATA? (1=YES, 0=NO)";
150 INPUT X
160 IF X = 1 THEN 20
170 PRINT "<CTRL-D>RUN HELLO"